<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>管理系统</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <?php if($form_parm_arr['static_html']){ ?>
    {$form_parm_arr['static_html']|raw}
  <?php }else{ ?>
    {:widget_st('layui','css')}
    {:widget_st('layui','js')}  
    {:widget_st('common','js')} 
    {:widget_st('ueditor')}  
    {:widget_st('jq','js')}
  <?php } ?> 

</head>
{:do_action('admin_head')}
<style>
  html{background-color: #fff;}
  .layui-card {box-shadow:0 0 0 0;}
  .layui-card-header{border-bottom: 0;}
  .layui-row{padding-top: 0;}
  .layui-fluid{padding-top:0;}
  .layui-tab{margin:0;}
</style>
<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <form class="info_tj" >
        <?php $form_widget = new \app\common\widget\FormPro();  ?>
        <div class="layui-tab layui-tab-brief">
          <ul class="layui-tab-title">
            <li class="layui-this">基本设置</li>
            <li>扩展参数</li>
          </ul>
          <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
              <input type="hidden" name="id" value="{$res['id']|default=''}">
              <?php if($form_parm_arr['form_parm'] && isset($form_parm_arr['form_parm']['ini']) && $form_parm_arr['form_parm']['ini']['zf_form_status']==1 ){ ?>
                {include file="public/tpl_diy_url"}
                {include file="public/form_parm_show"}
                {include file="public/widget_submit"}
              <?php }else{ ?>
                <!-- 默认表单 -->
                <div class="layui-col-sm12">
                {include file="public/tpl_diy_url"}
                <?php if(isset($res['id'])){ ?>
                    {$form_widget->form_input(['title'=>'名称','name'=>'name','data'=>$res['name'],'theme'=>1])|raw}
                    {$form_widget->form_input(['title'=>'排序','name'=>'sort','data'=>$res['sort'],'theme'=>1])|raw}
                    {$form_widget->form_ueditor(['title'=>'详情','name'=>'content','data'=>$res['content'],'theme'=>2])|raw}
                  <?php }else{ ?>
                    {$form_widget->form_input(['title'=>'名称','name'=>'name','data'=>'','theme'=>1])|raw}
                    {$form_widget->form_input(['title'=>'排序','name'=>'sort','data'=>'','theme'=>1])|raw}
                    {$form_widget->form_ueditor(['title'=>'详情','name'=>'content','data'=>'','theme'=>2])|raw}
                  <?php }?>
                  <div class="layui-col-sm3">
                    {include file="public/widget_submit"}
                  </div>
                </div>
              <?php } ?>
            </div>
            <div class="layui-tab-item">
              {include file="public/tpl_field_append"}
            </div>
          </div>
        </div>

      </form>
    </div>
  </div>


</body>
</html>
{:do_action('admin_js')}

<script>
  $(".tijiao").on("click",function(){
        var index = layer.load(2);
        <?php if(!isset($res['id'])){ ?>
          var url = '/admin/category/tag_add'
        <?php }else{ ?>
          var url = '/admin/category/tag_edit'
        <?php } ?>
        var data = $(".info_tj input,.info_tj textarea,.info_tj select").serialize();      
        $.ajax({
            type:'post',
            url:url,
            data:data,
            dataType:'json',
            success:function(res){
              layer.close(index);
              if(res.result==1){
                layer.msg(res.msg, {icon: 1});
                setTimeout(function() {
                  window.parent.location.reload();
                }, 2000);
              }else{
                layer.msg(res.msg, {icon: 2});
                
              }
              
            }
        })
      });

</script>